package z8.Common;

import zyn_hy_login.*;

public class Users
{
	private int id;
	private int id2;
	private int id3;
	private String name;
	private String yh_Connstr;
	private String yh_group;
	private String yh_login_name;
	private String yh_Tbname;
	private String yh_treeid;
	private String zt;

	public Users()
	{
	}

	public Users(int strId)
	{
		String text = "select * from z8 where sign='user' and  ";
		Object obj2 = text;
		DataRow row = DBCommon.getDataBySql(String.Concat(new Object[] {obj2, " id = ", strId, " "})).Tables[0].Rows[0];
		this.id = (Integer) row.getItem("id");
		this.id2 = (Integer) row.getItem("id2");










































		this.id3 = (Integer) row.getItem("id3");
		this.name = row.getItem("name").toString().trim();
		this.zt = row.getItem("zt").toString().trim();
		this.yh_login_name = row.getItem("x57").toString().trim();
		this.yh_treeid = row.getItem("id3").toString().trim();
		this.yh_group = row.getItem("x59").toString().trim();
		DB_conn _conn = new DB_conn(row.getItem("id3").toString().trim());
		this.yh_Connstr = _conn.getConnString();
		this.yh_Tbname = _conn.getDbTable();
	}

	public Users(String str_userName)
	{
		String text = "select * from z8 where sign='user' and  ";
		DataRow row = DBCommon.getDataBySqluniquetempvar.Tables[0].Rows[0];
		this.id = (Integer) row.getItem("id");
		this.id2 = (Integer) row.getItem("id2");
		this.id3 = (Integer) row.getItem("id3");
		this.name = row.getItem("name").toString().trim();
		this.zt = row.getItem("zt").toString().trim();
		this.yh_login_name = row.getItem("x57").toString().trim();
		this.yh_treeid = row.getItem("id3").toString().trim();
		this.yh_group = row.getItem("x59").toString().trim();
		DB_conn _conn = new DB_conn(row.getItem("id3").toString().trim());
		this.yh_Connstr = _conn.getConnString();
		this.yh_Tbname = _conn.getDbTable();
	}

	public final int UserCheck(String str_name, String str_pwd)
	{
		SecurityZ8 yz = new SecurityZ8();
		String text = "select id from z8 where sign='user' and ";
		return DBCommon.excuteSqlCount((text + " x57 = '" + str_name + "' and") + " x58 = '" + yz.Encrypt(str_pwd) + "'");
	}

	public final int getId()
	{
		return this.id;
	}
	public final void setId(int value)
	{
		this.id = value;
	}

	public final int getId2()
	{
		return this.id2;
	}
	public final void setId2(int value)
	{
		this.id2 = value;
	}

	public final int getId3()
	{
		return this.id3;
	}
	public final void setId3(int value)
	{
		this.id3 = value;
	}

	public final String getName()
	{
		return this.name;
	}
	public final void setName(String value)
	{
		this.name = value;
	}

	public final String getYh_Connstr()
	{
		return this.yh_Connstr;
	}
	public final void setYh_Connstr(String value)
	{
		this.yh_Connstr = value;
	}

	public final String getYh_group()
	{
		return this.yh_group;
	}
	public final void setYh_group(String value)
	{
		this.yh_group = value;
	}

	public final String getYh_login_name()
	{
		return this.yh_login_name;
	}
	public final void setYh_login_name(String value)
	{
		this.yh_login_name = value;
	}

	public final String getYh_Tbname()
	{
		return this.yh_Tbname;
	}
	public final void setYh_Tbname(String value)
	{
		this.yh_Tbname = value;
	}

	public final String getYh_treeid()
	{
		return this.yh_treeid;
	}
	public final void setYh_treeid(String value)
	{
		this.yh_treeid = value;
	}

	public final String getZt()
	{
		return this.zt;
	}
	public final void setZt(String value)
	{
		this.zt = value;
	}
}